// 首页默认发货地址 首页默认收货地址
class LocationModel {
  var id;
  int userId;
  var lat;
  var lng;
  String title;
  String address;
  String buildingNumber;
  String province;
  String city;
  String area;
  String town;
  String realname;
  var mobile;
  int type;
  int isDefault;
  int createtime;
  int updatetime;
  int deletetime;

  LocationModel(
      {this.id,
      this.userId,
      this.lat,
      this.lng,
      this.title,
      this.address,
      this.buildingNumber,
      this.province,
      this.city,
      this.area,
      this.town,
      this.realname,
      this.mobile,
      this.type,
      this.isDefault,
      this.createtime,
      this.updatetime,
      this.deletetime});

  LocationModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    userId = json['user_id'];
    lat = json['lat'];
    lng = json['lng'];
    title = json['title'];
    address = json['address'];
    buildingNumber = json['building_number'];
    province = json['province'];
    city = json['city'];
    area = json['area'];
    town = json['town'];
    realname = json['realname'];
    mobile = json['mobile'];
    type = json['type'];
    isDefault = json['is_default'];
    createtime = json['createtime'];
    updatetime = json['updatetime'];
    deletetime = json['deletetime'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['user_id'] = this.userId;
    data['lat'] = this.lat;
    data['lng'] = this.lng;
    data['title'] = this.title;
    data['address'] = this.address;
    data['building_number'] = this.buildingNumber;
    data['province'] = this.province;
    data['city'] = this.city;
    data['area'] = this.area;
    data['town'] = this.town;
    data['realname'] = this.realname;
    data['mobile'] = this.mobile;
    data['type'] = this.type;
    data['is_default'] = this.isDefault;
    data['createtime'] = this.createtime;
    data['updatetime'] = this.updatetime;
    data['deletetime'] = this.deletetime;
    return data;
  }
}

class LocationListModel {
  int code;
  String msg;
  String time;
  List<LocationModel> data;

  LocationListModel({this.code, this.msg, this.time, this.data});

  LocationListModel.fromJson(Map<String, dynamic> json) {
    code = json['code'];
    msg = json['msg'];
    time = json['time'];
    if (json['data'] != null) {
      data = new List<LocationModel>();
      json['data'].forEach((v) {
        data.add(new LocationModel.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['code'] = this.code;
    data['msg'] = this.msg;
    data['time'] = this.time;
    if (this.data != null) {
      data['data'] = this.data.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class LocationCellModel {
  int id;
  int userId;
  String lat;
  String lng;
  String address;
  String buildingNumber;
  String province;
  String city;
  String area;
  String town;
  String realname;
  String mobile;
  int type;
  int isDefault;
  int createtime;
  int updatetime;
  int deletetime;

  LocationCellModel(
      {this.id,
      this.userId,
      this.lat,
      this.lng,
      this.address,
      this.buildingNumber,
      this.province,
      this.city,
      this.area,
      this.town,
      this.realname,
      this.mobile,
      this.type,
      this.isDefault,
      this.createtime,
      this.updatetime,
      this.deletetime});

  LocationCellModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    userId = json['user_id'];
    lat = json['lat'];
    lng = json['lng'];
    address = json['address'];
    buildingNumber = json['building_number'];
    province = json['province'];
    city = json['city'];
    area = json['area'];
    town = json['town'];
    realname = json['realname'];
    mobile = json['mobile'];
    type = json['type'];
    isDefault = json['is_default'];
    createtime = json['createtime'];
    updatetime = json['updatetime'];
    deletetime = json['deletetime'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['user_id'] = this.userId;
    data['lat'] = this.lat;
    data['lng'] = this.lng;
    data['address'] = this.address;
    data['building_number'] = this.buildingNumber;
    data['province'] = this.province;
    data['city'] = this.city;
    data['area'] = this.area;
    data['town'] = this.town;
    data['realname'] = this.realname;
    data['mobile'] = this.mobile;
    data['type'] = this.type;
    data['is_default'] = this.isDefault;
    data['createtime'] = this.createtime;
    data['updatetime'] = this.updatetime;
    data['deletetime'] = this.deletetime;
    return data;
  }
}
